<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#d1{
				display: flex;
				border: 2px double red;
				flex-flow: row nowrap;
				width: 600px;
			}
			#d1 div{
				height: 100px;
				width: 100px;
				line-height: 100px;
				
				text-align: center;
				font-size: 19px;
				margin: 5px;
				background-color: darkgrey;
				flex-grow: 2;
				
			}
			#d1 .f1{
				flex-shrink: 1;
			}
			#d1 .f2{
				flex-shrink: 2;
			}
			#d1 div#d5{
				order: -3;
			}
		</style>
	</head>
	<body>
		<div id="d1">
			<div class="f1">1</div>
			<div class="f1">2</div>
			<div class="f1">3</div>
			<div class="f2">4</div>
			<div id="d5"  class="f2">5</div>
			<div class="f2">6</div>
			<div class="f2">7</div>
			<div class="f2">8</div>
		</div>
	</body>
</html>
